<nz-tab>
    <ng-template #nzTabHeading>
        班级管理
    </ng-template>
    <div class="search-add-box">
        班级名称：<nz-input [nzPlaceHolder]="'请输入查询班级名称'" [(ngModel)]="searchValue" style="width: 200px;" [nzSize]="'large'"></nz-input>
        <button nz-button type="submit" class="mar-left" [nzType]="'primary'" [nzSize]="'large'" (click)="search()">查询</button>
        <button nz-button class="btn-right" [nzType]="'default'" [nzSize]="'large'" *ngIf="_checkTable.length > 0" (click)="allDelete()">
            <span>批量删除</span>
        </button>
        <button nz-button class="btn-right" (click)="modal('add', '')" [nzType]="'primary'" [nzSize]="'large'">
            <i class="anticon anticon-plus"></i><span>新建</span>
        </button>
    </div>
    <nz-table #nzTable2 [nzDataSource]="data" [nzPageSize]="10" (nzDataChange)="_displayDataChange($event)" (nzPageIndexChange)="_refreshStatus()" (nzPageSizeChange)="_refreshStatus()" [nzLoading]="_loading">
        <thead nz-thead>
        <tr>
            <th nz-th [nzCheckbox]="true">
                <label nz-checkbox [(ngModel)]="_allChecked" [nzIndeterminate]="_indeterminate" (ngModelChange)="_checkAll($event)">
                </label>
            </th>
            <th  nz-th><span>班级名称</span></th>
            <th  nz-th><span>学院名称</span></th>
            <th  nz-th><span>教师名称</span></th>
            <th  nz-th><span>在读学生数</span></th>
            <th  nz-th><span>状态</span></th>
            <th  nz-th><span>操作</span></th>
        </tr>
        </thead>
        <tbody nz-tbody>
        <tr nz-tbody-tr *ngFor="let data of nzTable2.data;let i = index">
            <td nz-td [nzCheckbox]="true">
                <label nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_refreshStatus($event)">
                </label>
            </td>
            <td nz-td>{{data.C_name}}</td>
            <td nz-td>{{data.C_college}}</td>
            <td nz-td>{{data.C_teacher_name}}</td>
            <td nz-td>{{data.C_count}}</td>
            <td nz-td>{{Status[i]}}</td>
            <td nz-td>
                <span>
                  <a (click)="info(contentTpl,data,Status[i])">查看</a>
                  <span nz-table-divider></span>
                  <a (click)="modal ('update', data)">修改</a>
                  <span nz-table-divider></span>
                  <a (click)="showConfirm(data)">删除</a>
                </span>
            </td>
        </tr>
        </tbody>
    </nz-table>
    <nz-modal  [nzWrapClassName]="'vertical-center-modal'" [nzVisible]="modalVisible2" [nzTitle]="popTitle" [nzConfirmLoading]="loading" [nzContent]="modalContent2"
               (nzOnCancel)="modalVisible2=false" (nzOnOk)="save()">
        <ng-template #modalContent2>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-label class="til-box">班级名称：</div>
                <div nz-form-control class="flex-1">
                    <nz-input [(ngModel)]="Cname" name="description" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                </div>
                <div nz-form-label class="til-box">院校名称：</div>
                <div nz-form-control class="flex-1">
                    <nz-input [(ngModel)]="Cschool" name="description" [nzSize]="'large'" [nzPlaceHolder]="'请输入'" nzId="no"></nz-input>
                </div>
            </div>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-label class="til-box">教师名称：</div>
                <div nz-form-control class="flex-1">
                    <nz-select style="width: 164px;" [nzPlaceHolder]="'请选择'" [(ngModel)]="selectValue1" [nzSize]="'large'" [nzShowSearch]="true">
                        <nz-option
                            *ngFor="let option of option1"
                            [nzLabel]="option.label"
                            [nzValue]="option.value"
                            [nzDisabled]="option.disabled">
                        </nz-option>
                    </nz-select>
                </div>
                <div nz-form-label class="til-box">在读人数：</div>
                <div nz-form-control class="flex-1">
                    <nz-input-number [(ngModel)]="CNum" [nzMin]="0" [nzMax]="10000" [nzStep]="1"></nz-input-number>
                </div>
            </div>
            <div nz-form-item class="d-flex d-flex-margin">
                <div nz-form-label class="til-box">班级状态：</div>
                <div nz-form-control class="flex-1">
                    <nz-select style="width: 164px;" [nzPlaceHolder]="'请选择'" [(ngModel)]="selectValue2" [nzSize]="'large'" [nzShowSearch]="true">
                        <nz-option
                            *ngFor="let option of option2"
                            [nzLabel]="option.label"
                            [nzValue]="option.value"
                            [nzDisabled]="option.disabled">
                        </nz-option>
                    </nz-select>
                </div>
            </div>
        </ng-template>
    </nz-modal>
    <ng-template #contentTpl>
        <div nz-form-item class="d-flex d-flex-margin">
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">班级名称：</div>
                {{Cname}}
            </div>
        </div>
        <div nz-form-item class="d-flex d-flex-margin">
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">院校名称：</div>
                {{Cschool}}
            </div>
        </div>
        <div nz-form-item class="d-flex d-flex-margin">
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">教师名称：</div>
                {{CTeacher}}
            </div>
        </div>
        <div nz-form-item class="d-flex d-flex-margin">
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">在读人数：</div>
                {{CNum}}
            </div>
        </div>
        <div nz-form-item nz-row>
            <div nz-form-control class="flex-1">
                <div nz-form-label class="til-box">班级状态：</div>
                {{selectValue2}}
            </div>
        </div>
    </ng-template>
</nz-tab>
